package com.uzai.console.web.tb.tbstoreblacklist;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.tb.tbstoreblacklist.StoreBlacklistPrvIdDto;
import com.uzai.console.dto.tb.tbstoreblacklist.StoreBlacklistPrvInfoDto;
import com.uzai.console.dto.tb.tbstoreblacklist.StoreBlacklistPrvQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.tb.tbstoreblacklist.StoreBlacklistPrvService;
import com.uzai.console.vo.tb.tbstoreblacklist.StoreBlacklistPrvInfoVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户管理|云黑名单|店铺私有黑名单
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "店铺私有黑名单",tags = "淘宝|店铺黑名单|私有黑名单")
@ApiSort(9)
@RestController
public class TbStoreBlacklistPrvController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(TbStoreBlacklistPrvController.class);

    @Autowired
    private StoreBlacklistPrvService storeBlacklistPrvService;

    @ApiOperation(value = "分页查询私有黑名单列表", notes = "分页查询私有黑名单列表", response = StoreBlacklistPrvInfoVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/storeBlacklistPrv/findStoreBlacklistPrvList")
    public Object findStoreBlacklistPrvList(@RequestBody StoreBlacklistPrvQuery storeBlacklistPrvQuery){
        return storeBlacklistPrvService.findStoreBlacklistPrvList(storeBlacklistPrvQuery);
    }

    @SystemLogType(model = SystemModelEnum.StoreBlacklistPrv, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "添加私有黑名单", notes = "添加私有黑名单")
    @ApiOperationSupport(order = 2)
    @PostMapping("/storeBlacklistPrv/addStoreBlacklistPrv")
    public Object addStoreBlacklistPrv(@RequestBody StoreBlacklistPrvInfoDto storeBlacklistPrvInfoDto){
        storeBlacklistPrvService.addStoreBlacklistPrv(storeBlacklistPrvInfoDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.StoreBlacklistPrv, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "移除私有黑名单", notes = "移除私有黑名单")
    @ApiOperationSupport(order = 4)
    @PostMapping("/storeBlacklistPrv/deleteStoreBlacklistPrv")
    public Object deleteStoreBlacklistPrv(@RequestBody StoreBlacklistPrvIdDto storeBlacklistPrvIdDto){
        storeBlacklistPrvService.deleteStoreBlacklistPrv(storeBlacklistPrvIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.StoreBlacklistPrv, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "加入全网黑名单", notes = "加入全网黑名单")
    @ApiOperationSupport(order = 5)
    @PostMapping("/storeBlacklistPrv/shareStoreBlacklistPub")
    public Object shareStoreBlacklistPub(@RequestBody StoreBlacklistPrvIdDto storeBlacklistPrvIdDto){
        storeBlacklistPrvService.shareStoreBlacklistPub(storeBlacklistPrvIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.StoreBlacklistPrv, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "取消全网黑名单", notes = "取消全网黑名单")
    @ApiOperationSupport(order = 8)
    @PostMapping("/storeBlacklistPrv/cancleStoreBlacklistPub")
    public Object cancleStoreBlacklistPub(@RequestBody StoreBlacklistPrvIdDto storeBlacklistPrvIdDto){
        storeBlacklistPrvService.cancelStoreBlacklistPub(storeBlacklistPrvIdDto);
        return true;
    }

}
